const multer = require("multer");

const storage = multer.diskStorage({
  // 保存路径
  destination: function (req, file, cb) {
    cb(null, "public/picture");
  },
  // 保存文件名
  filename: function (req, file, cb) {
    cb(null, Date.now() + "-" + file.originalname);
  },
});

const upload = multer({ storage });
module.exports = upload;
